package lanqiao;

import java.util.Scanner;

public class SubtractOne {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = n, count = 0;
        int[] arr = new int[10];
        int i = 0;
        while (n != 0) {
            a = a % 10;
            if (a != 0) a--;
            arr[i] = a;
            i++;
            n = n / 10;
            a = n;
            count++;
        }
        int nums[] = new int[count];
        for (int j = nums.length - 1; j >= 0; j--) {
            System.out.print(arr[j]);
        }
    }
}
